package com.qf.controller;

import com.qf.pojo.User;
import com.qf.service.CarService;
import com.qf.service.UserService;
import com.qf.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/car")
public class CarController {

    @Autowired
    CarService carService;

    @RequestMapping(value = "/price",method = RequestMethod.POST)
    public BaseResult findAllByPrice(){
        return carService.findAllByPrice();
    }

    @RequestMapping(value = "/hot",method = RequestMethod.POST)
    public BaseResult findAllByhot(){
        return carService.findAllByHot();
    }

    @RequestMapping(value = "/findcar",method = RequestMethod.GET)
    public BaseResult findCar(@RequestParam("cid") int cid){
        return carService.findCarById(cid);
    }
}
